<?php

declare(strict_types=1);

namespace app\yperp\command;

use app\cms\model\Support;
use app\yperp\common\Changhong;
use app\yperp\common\GdImage;
use app\yperp\common\yp\YpLogin;
use app\yperp\common\MyWebDriver;
use app\yperp\common\Tools;
use app\yperp\common\yp\YpExpress;
use app\yperp\common\yp\YpOrder;
use app\yperp\job\GoodsAsync;
use app\yperp\job\GoodsDetailAsync;
use app\yperp\job\MgtJob;
use app\yperp\job\SupplierAsync;
use app\yperp\logic\ConflateMainImg;
use app\yperp\logic\GoodsAsync as LogicGoodsAsync;
use app\yperp\logic\GoodsListAsync;
use app\yperp\logic\Standby;
use app\yperp\logic\ypapp\CheckGoods;
use app\yperp\model\Supplier;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;
use think\facade\Cache;
use think\Db;
use Endroid\QrCode\QrCode;
use Endroid\QrCode\Writer\ConsoleWriter;
use Exception;
// use Fastposter\Client;
use think\Queue;
use ZipArchive;
use Zxing\QrReader;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\WebDriverBy;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client as GuzzleHttpClient;
use think\Db as ThinkDb;
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;
// 导入PHP内置的AES和MD5函数
use phpseclib3\Crypt\AES as AES;
use phpseclib3\Hash\MD5 as MD5;

class conflateimg extends Command
{

    protected $output;

    protected $input;
    protected $driver;
    protected $windows = [];
    protected $cookies = [];
    protected function configure()
    {
        // 指令配置
        $this->setName('conflateimg')->setDescription('批量重置商品首图');
    }

    protected function execute(Input $input, Output $output)
    {
        // 指令输出
        $this->input = $input;

        $this->output = $output;

        // Tools::ypapp();
        try {
            //code...

            foreach ($this->goods as $key => $value) {
                # code...
                dump($value);
                $res =  Supplier::where(['goods_sku_alias' =>  $value[2]])->where('status > 0')->find();

                ConflateMainImg::getInstance()->conflate($res['id']);
            }
        } catch (\Throwable $th) {
            //throw $th;
            dump($th->getMessage());
            dump($th->getTraceAsString());
        }
    }
    public $goods = [
        // ["S00345347", "立白大师香氛天然洗衣液|1kg*1袋", "csmb_dsxf1kg-1d"],
        // ["S00345374", "立白大师香氛香水型持久留香洗衣液|香氛液1kg*1瓶+1kg1袋", "csmb_ds-1kg-1kg"],
        // ["S00345375", "立白大师香氛天然洗衣液|1kg*1瓶+1kg*2袋装", "csmb_ds1kg-ds2kg"],
        // ["S00345818", "舒可乐420张抽纸大包餐巾纸家用卫生纸批发母婴纸抽|18包【实惠装】", "csmb_18b-4356"],
        // ["S00345819", "立白大师香氛洗衣液+内衣专用除菌皂|1kg*1袋+1块", "csmb_ds1kgd-z101g"],
        ["S00345820", "立白大师香氛洗衣液|立白大师洗衣液【2瓶+2袋】", "csmb_ds1kg2-500g2"],
        // ["S00345821", "馋小赖麻辣荤素零食大礼包|110包荤素礼包", "csmb_HQC-110"],
        // ["S00345822", "佳燕 80抽大包装加厚婴儿湿巾宝宝手口专用湿纸巾|140*180mm * 2包", "csmb_JY-833"],
        // ["S00345823", "幸运女神国潮风一次性纯棉洗脸巾干湿两用|【20*20CM】加厚50抽 * 2包", "csmb_XLJ-661"],
        // ["S00345824", "佳燕佳丽洁面巾一次性孕婴儿干湿两用卸妆洁面巾 * 2包", "csmb_JL001"],
        // ["S00345863", "吃欢天蟹黄拌面桶装宿舍野餐早餐|吃欢天蟹黄拌面77g *12杯", "csmb_76101212"],
        // ["S00345874", "鲜在香辣香脆火腿肠热狗香肠|40支经济装（划算）推荐", "csmb_ZH11100440"],
        // ["S00345887", "壹得利 海苔肉松吐司乳酪夹心面包|海苔肉松吐司-16包", "csmb_htrsts-16b"],
        // ["S00345892", "秋梨枇杷果冻 清甜多汁清润爽口|秋梨枇杷果冻760g * 2罐", "csmb_QLPPGD-760-2"],
        // ["S00346761", "汉世刘家 垃圾袋家用抽绳手提式加厚实惠装45*40cm|【1卷60只体验装】黑色", "csmb_HSZY-CS002-4540-1L"],
        // ["S00346762", "刻凡 红豆沙青团 200g|【袋装4枚】", "csmb_KFZZ101975001"],
        // ["S00346763", "洁柔纸巾 家用立体压花擦手纸抽纸3层100抽|3包", "csmb_jrPPR238-03Rcz3b"],
        // ["S00346764", "致佳成人款室内运动负重轴承无绳跳绳器|太空黑", "csmb_TS330-30WS01"],
        // ["S00346766", "汽车四季通用去污玻璃水强效去油膜|【0℃升级型1.3L】2瓶", "csmb_GZ-8094"],
        // ["S00346767", "致佳 八字拉力器家用开肩美背瘦背健身|绿色", "csmb_BZLLQ180-06"],
        // ["S00346768", "汉世刘家 垃圾袋家用抽绳手提式加厚实惠装45*40cm|【5卷100只】金银色", "csmb_HSLJ-1259-JGD"],
        // ["S00346769", "立白APG薄荷洗洁精|1.3kg*2瓶", "csmb_apg1.3-2"],
        // ["S00346808", "立白卫仕洁净除菌去污洗衣液|100g*3袋", "csmb_ws100g-3"],
        // ["S00346809", "立白大师香氛洗衣粉|35g*6袋", "csmb_ds-35g-6"],
        // ["S00346815", "立白女士专用薰衣香除菌抑菌除螨内衣皂|101g（2块装）", "csmb_cn_lib_lkz_1-2"],
        // ["S00346816", "家用食品级密封保鲜袋|【双筋】20个袋装大", "csmb_A117-17"],
        // ["S00346827", "乐唯诗 家用高颜值简约牛奶玻璃杯|浮雕把杯【430ml*1】", "csmb_00211692"],
        // ["S00346830", "乐唯诗 家用高颜值简约牛奶玻璃杯|竖纹杯【220ML*1】", "csmb_00000515"],
        // ["S00346831", "乐唯诗 家用高颜值简约牛奶玻璃杯|扭纹杯【琥珀色*1】", "csmb_00000358"],
        // ["S00346840", "【真好意】网红锅巴薯片牛角酥零食|三种口味混合【火锅牛角酥】", "csmb_GBHH20"],
        // ["S00346841", "【真好意】网红锅巴薯片牛角酥零食|烤肉味【火锅牛角酥】", "csmb_KRWGB20"],
        // ["S00346842", "【真好意】网红锅巴薯片牛角酥零食|番茄味【火锅牛角酥】", "csmb_FQWGB20"],
        // ["S00346847", "【真好意】网红锅巴薯片牛角酥零食|香辣味【火锅牛角酥】", "csmb_XLWGB20"],
        // ["S00346998", "芋相莲 无蔗糖绿豆紫薯南瓜 粗粮|绿豆+南瓜+紫薯-6个混合装", "csmb_yxl-ywngzs-6ghhz"],
        // ["S00346999", "五黑桑葚黑芝麻黑枸杞紫米饼|五黑桑葚紫米饼-5个装", "csmb_whsrzmb-5gz"],
        // ["S00347018", "家用挂衣防滑晾衣架|樱花粉【防滑不鼓包】", "csmb_PDDXWS-PTJSYJ-01"],
        // ["S00347019", "清风BR43NCE3抽纸|4包一提", "csmb_qfBR43NCE3cz4b"],
        // ["S00347260", "立白大师香氛天然洗衣液|1kg*2袋", "csmb_dsxf1kg-2d"],
        // ["S00347261", "立白大师香氛天然洗衣液|1kg*3袋", "csmb_dsxf1kg*3d"],
        // ["S00347262", "立白内衣专护除菌洗衣液|250g*1瓶", "csmb_nyzh250-1"],
        // ["S00347263", "立白精品青提茉莉洗洁精|488g*2瓶", "csmb_jp488-2"],
        // ["S00347265", "立白miss蜜丝内衣专护洗衣液|480g*1瓶", "csmb_xyy_ms_ms_480-1"],
        // ["S00347266", "立白石榴精华浓缩果醋洗洁精|500g*1瓶", "csmb_xjj_lb_gc_500-1"],
        // ["S00347267", "立白石榴精华浓缩果醋洗洁精|1kg*1瓶", "csmb_xjj_lb_gc_1000-1"],
        // ["S00347268", "立白miss蜜丝丁香植萃内衣清洗液|480g*1瓶", "csmb_msdxy480g-1"],
        // ["S00347269", "立白御品海洋精华洗衣液|1000g*2瓶", "csmb_hyyp2kgxb-1"],
        // ["S00347270", "立白精品青提茉莉洗洁精|488g*1瓶", "csmb_jp488-1"],
        // ["S00347272", "立白全自动浓缩洗衣粉|1.3kg两袋", "csmb_nsf_lb_dz_1300-2"],
        // ["S00347273", "立白内衣专护除菌洗衣液|250g*2瓶", "csmb_ny250-2"],
        // ["S00347274", "立白御品海洋精华洗衣液|1000g*1瓶", "csmb_yp-hyjhfs1-1"],
        // ["S00347293", "立白好爸爸高端樱花洗衣液|2.8kg一瓶", "csmb_yhmwcy2.8kg-1"],
        // ["S00347294", "立白好爸爸天然植物基亲肤洗衣露|220g两瓶", "csmb_hbb-zwj220g-2"],
        // ["S00347298", "立白好爸爸高端亲肤樱花洗衣皂粉|2008g*一袋", "csmb_hbbyhzf2008-1"],
        // ["S00347300", "立白好爸爸高端亲肤樱花洗衣皂粉|1308g*两袋", "csmb_hbbyhzf1308-2"],
        // ["S00347301", "立白好爸爸0添加食品用果蔬餐具净洗洁精|1kg*2瓶", "csmb_cjj-hbbgs-2"],
        // ["S00347639", "云南特产高山百香果一级果|5斤", "csmb_bxg-fx-D05"],
        // ["S00347640", "云南特产郁金香小香瓜-大果|5斤", "csmb_XXGY-FX-D05"],
        // ["S00348140", "戚小贝 广西特产真空装肉粽子绿豆五花肉粽|250g*4条", "csmb_xrldz250kX4t"],
        // ["S00348141", "戚小贝 广西特产真空装凉粽子原味灰水粽|200g*4条", "csmb_hsz200kX4t"],
        // ["S00348142", "戚小贝 广西特产真空装甜凉粽子Q弹甜味粽|100g*6个", "csmb_Qdbltz100kX6z"],
        // ["S00348143", "鹿辰福建特产20天短保无蔗糖全麦龙井茶酥|10个装【约450g】", "csmb_qmljs-10gz"],
        // ["S00348373", "清风超质感纸巾抽纸3层110抽【1提3包】*2", "csmb_qfBR33SXE1cz6b"],
        // ["S00348374", "清风小包随身装手帕纸3层10包 *3条装", "csmb_qfB66ACM13spz3t"],
        // ["S00348375", "塔菲克 手机tpye-c数据线1.5m*1条装", "csmb_160945"],
        // ["S00348376", "塔菲克 双typec头PD60W快充数据线|1.5m*1条装", "csmb_6972440708645"],
        // ["S00348377", "塔菲克【追剧神器】通用折叠升降手机支架|【经典黑】", "csmb_161320"],
        // ["S00348378", "塔菲克【追剧神器】通用折叠升降手机支架|【象牙白】", "csmb_161323"],
        // ["S00348387", "塔菲克数据线三合一|1米【一拖三】1条装", "csmb_164620"],
        // ["S00348388", "立白植物洗衣皂|232g*两块装", "csmb_xyz_lb_zwz_2-2"],
        // ["S00348390", "立白全效馨香洗衣液|900g一袋", "csmb_xyy_qxxx_900-1"],
        // ["S00348391", "塔菲克苹果iPhone iPad 通用数据线|1.5米*1条装", "csmb_6970073276104"],
        // ["S00348392", "立白大师香氛洗衣皂|360g【1包】", "csmb_dsxyz-360-1"],
        // ["S00348393", "鹿辰福建特产20天短保无蔗糖黄金南瓜饼|10个装【约500g】", "csmb_hjngb-cb-500g"],
        // ["S00348406", "立白茶籽洗洁精|1kg*1瓶", "csmb_xjj_lb_czxj_yqk-1"],
        // ["S00348425", "健美创研 双头棉签|【清洁款500支】圆头+螺旋头", "csmb_6970221610422"],
        // ["S00348426", "健美创研 双头棉签|【化妆款500支】圆头+尖头", "csmb_6970221610408"],
        // ["S00348427", "健美创研 双头棉签|【常规款500支】双头圆", "csmb_6970221610385"],
        // ["S00348428", "健美创研 加厚珍珠纹洁面巾|100抽*一盒", "csmb_6974448160463"],
        // ["S00348434", "洁又佳 抽绳式彩色加厚垃圾袋45*50|10卷150只", "csmb_CSJH-CAI10"],
        // ["S00348469", "百屹家居太阳花杯茶杯水杯|【4只装】", "csmb_tyhbx4"],
        // ["S00348470", "百屹家居光面啤酒杯茶杯水杯|【4只装】", "csmb_gmpjbx4"],
        // ["S00348471", "顺艺 无痕护肩浸塑衣架浅咖 40.5cm护肩款|10个装", "csmb_SY071-N"]
    ];
}
